<?php 

final class Busca_Model extends Model {

	public function buscar($valor_busca) {
		$conn = $this->db;
		$stmt = $conn->prepare("SELECT m.codigo,m.nome,m.preco,m.estoque,c.cat_nome FROM miniaturas 
		AS m INNER JOIN categorias AS c ON m.id_categoria=c.id WHERE m.nome LIKE '%$valor_busca%';");
		$stmt->execute();
		$rs = $stmt->fetchAll(PDO::FETCH_OBJ);
		return $rs;
	}
	
}

?>